#ifndef __APP_BUFFER_H__
#define __APP_BUFFER_H__
#include <pthread.h>

typedef struct BufferStruct{
    void* ptr;
    int size;
    int start;
    int len;
    pthread_mutex_t lock;
}Buffer;

int app_buffer_init(Buffer* buffer, int size);
int app_buffer_read(Buffer* buffer, void* buf, int len);
int app_buffer_write(Buffer* buffer, void* buf, int len);
void app_buffer_close(Buffer* Buffer);
#endif